package messageHandler;

import screen.StudyEnglishScr;
import network.Cmd_Message;
import network.Message;

public class GameStudyEnglishMsgHandler extends GameCenterMsgHandler{
	static GameStudyEnglishMsgHandler m_instance = null;
	
    public static GameStudyEnglishMsgHandler gI() {
        if (m_instance == null) {
            m_instance = new GameStudyEnglishMsgHandler();
        }
        return m_instance;
    }
	
	public static void onHandler() {		
		GlobalMsgHandler.gI().miniGameMessageHandler = GameStudyEnglishMsgHandler.gI();			
	}
	public void onMessage(Message msg) {
		// TODO Auto-generated method stub
		
		try {
			
            switch (msg.command) {
            case Cmd_Message.UPDATE_SMART:
            	byte roomID = msg.reader().readByte();
            	byte boardID = msg.reader().readByte();
            	int whoWin = msg.reader().readInt();
            	int smart = msg.reader().readShort();
            	StudyEnglishScr.gI().updateSmart(whoWin, smart);
            	break;
            	           	
            default:
            	super.onMessage(msg);
            	break;
            }
		}catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        
	}
}
